package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbSellerMapper;
import com.dongdongshop.pojo.TbSeller;
import com.dongdongshop.service.TbSellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class TbSellerServiceImpl implements TbSellerService {
    @Autowired
    private TbSellerMapper tbSellerMapper;
    @Override
    public List<TbSeller> finfSeller() {
        List<TbSeller> tbSellers = tbSellerMapper.selectByExample(null);
        return tbSellers;
    }

    @Override
    public TbSeller selectById(String obj) {
        TbSeller tbSeller = tbSellerMapper.selectByPrimaryKey(obj);
        return tbSeller;
    }

    @Override
    public void updateServller(TbSeller tbSeller) {
        tbSellerMapper.updateByPrimaryKeySelective(tbSeller);
    }

    @Override
    public void addSeller(TbSeller seller) {
        tbSellerMapper.insertSelective(seller);
    }

    @Override
    public TbSeller selectSellerById(String username) {
        TbSeller tbSeller = tbSellerMapper.selectByPrimaryKey(username);
        return tbSeller;
    }
}
